
const { exec } = require('../db')
// model: sql查询模型
class UsersService {
  async login(ctx, next) {
    // const { username, password } = ctx.query;
    const { username, password } = ctx.query;
    // exec 数据查询操作/i/o ---> 异步操作
    // 前面写 = 叫同步赋值
    return await exec(`select * from users where username='${username}' and password='${password}'`)

  }
}

module.exports = new UsersService()